import Select from './Select';
import Link from './Link';

export const MySelect = {};
export const MyLink = {};

MySelect.install = Vue => Vue.component(Select.name, Select);
MyLink.install = Vue => Vue.component(Link.name, Link);

const MyUI = {};

const componentPool = [
  Select,
  Link
];

MyUI.install = (app, options) => {

  if (options && options.components) {
    const component = options.components;

    component.map(compName => {
      componentPool.map(c => {
        if (compName === c.name) {
          app.component(c.name, c);
        }
      })
    })

  } else {
    componentPool.map(c => {
      app.component(c.name, c);
    })
  }

}

export default MyUI;